/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyivtbmob")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyivtbmob.findAll", query = "SELECT p FROM Pyivtbmob p"),
    @NamedQuery(name = "Pyivtbmob.findByPyivtbmobid", query = "SELECT p FROM Pyivtbmob p WHERE p.pyivtbmobid = :pyivtbmobid"),
    @NamedQuery(name = "Pyivtbmob.findByDescripcion", query = "SELECT p FROM Pyivtbmob p WHERE p.descripcion = :descripcion"),
    @NamedQuery(name = "Pyivtbmob.findByValorpresup", query = "SELECT p FROM Pyivtbmob p WHERE p.valorpresup = :valorpresup"),
    @NamedQuery(name = "Pyivtbmob.findByValoradqu", query = "SELECT p FROM Pyivtbmob p WHERE p.valoradqu = :valoradqu"),
    @NamedQuery(name = "Pyivtbmob.findByMaterialpred", query = "SELECT p FROM Pyivtbmob p WHERE p.materialpred = :materialpred"),
    @NamedQuery(name = "Pyivtbmob.findByNumerofactura", query = "SELECT p FROM Pyivtbmob p WHERE p.numerofactura = :numerofactura"),
    @NamedQuery(name = "Pyivtbmob.findByFechacompra", query = "SELECT p FROM Pyivtbmob p WHERE p.fechacompra = :fechacompra"),
    @NamedQuery(name = "Pyivtbmob.findByCaracteristicas", query = "SELECT p FROM Pyivtbmob p WHERE p.caracteristicas = :caracteristicas"),
    @NamedQuery(name = "Pyivtbmob.findByRefactaentrega", query = "SELECT p FROM Pyivtbmob p WHERE p.refactaentrega = :refactaentrega"),
    @NamedQuery(name = "Pyivtbmob.findByCodbien", query = "SELECT p FROM Pyivtbmob p WHERE p.codbien = :codbien"),
    @NamedQuery(name = "Pyivtbmob.findByFecharegistro", query = "SELECT p FROM Pyivtbmob p WHERE p.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Pyivtbmob.findByObservaciones", query = "SELECT p FROM Pyivtbmob p WHERE p.observaciones = :observaciones")})
public class Pyivtbmob implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyivtbmobid")
    private Integer pyivtbmobid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "descripcion")
    private String descripcion;
    @Basic(optional = false)
    @NotNull
    @Column(name = "valorpresup")
    private double valorpresup;
    @Basic(optional = false)
    @NotNull
    @Column(name = "valoradqu")
    private double valoradqu;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "materialpred")
    private String materialpred;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "numerofactura")
    private String numerofactura;
    @Column(name = "fechacompra")
    @Temporal(TemporalType.DATE)
    private Date fechacompra;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 400)
    @Column(name = "caracteristicas")
    private String caracteristicas;
    @Size(max = 20)
    @Column(name = "refactaentrega")
    private String refactaentrega;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 16)
    @Column(name = "codbien")
    private String codbien;
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @JoinColumn(name = "scittbescunid", referencedColumnName = "scittbescunid")
    @ManyToOne(optional = false)
    private Scittbescun scittbescunid;
    @JoinColumn(name = "pyivtbusobienid", referencedColumnName = "pyivtbusobienid")
    @ManyToOne(optional = false)
    private Pyivtbusobien pyivtbusobienid;
    @JoinColumn(name = "pyivtbestabienid", referencedColumnName = "pyivtbestabienid")
    @ManyToOne(optional = false)
    private Pyivtbestabien pyivtbestabienid;
    @JoinColumn(name = "pyivtbcolorid", referencedColumnName = "pyivtbcolorid")
    @ManyToOne(optional = false)
    private Pyivtbcolor pyivtbcolorid;
    @JoinColumn(name = "pydgtbactivpoaid", referencedColumnName = "pyfntbactivpoaid")
    @ManyToOne(optional = false)
    private Pyfntbactivpoa pydgtbactivpoaid;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyivtbmobid")
    private Collection<Pyivtbtrasmob> pyivtbtrasmobCollection;

    public Pyivtbmob() {
    }

    public Pyivtbmob(Integer pyivtbmobid) {
        this.pyivtbmobid = pyivtbmobid;
    }

    public Pyivtbmob(Integer pyivtbmobid, String descripcion, double valorpresup, double valoradqu, String materialpred, String numerofactura, String caracteristicas, String codbien, String observaciones) {
        this.pyivtbmobid = pyivtbmobid;
        this.descripcion = descripcion;
        this.valorpresup = valorpresup;
        this.valoradqu = valoradqu;
        this.materialpred = materialpred;
        this.numerofactura = numerofactura;
        this.caracteristicas = caracteristicas;
        this.codbien = codbien;
        this.observaciones = observaciones;
    }

    public Integer getPyivtbmobid() {
        return pyivtbmobid;
    }

    public void setPyivtbmobid(Integer pyivtbmobid) {
        this.pyivtbmobid = pyivtbmobid;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public double getValorpresup() {
        return valorpresup;
    }

    public void setValorpresup(double valorpresup) {
        this.valorpresup = valorpresup;
    }

    public double getValoradqu() {
        return valoradqu;
    }

    public void setValoradqu(double valoradqu) {
        this.valoradqu = valoradqu;
    }

    public String getMaterialpred() {
        return materialpred;
    }

    public void setMaterialpred(String materialpred) {
        this.materialpred = materialpred;
    }

    public String getNumerofactura() {
        return numerofactura;
    }

    public void setNumerofactura(String numerofactura) {
        this.numerofactura = numerofactura;
    }

    public Date getFechacompra() {
        return fechacompra;
    }

    public void setFechacompra(Date fechacompra) {
        this.fechacompra = fechacompra;
    }

    public String getCaracteristicas() {
        return caracteristicas;
    }

    public void setCaracteristicas(String caracteristicas) {
        this.caracteristicas = caracteristicas;
    }

    public String getRefactaentrega() {
        return refactaentrega;
    }

    public void setRefactaentrega(String refactaentrega) {
        this.refactaentrega = refactaentrega;
    }

    public String getCodbien() {
        return codbien;
    }

    public void setCodbien(String codbien) {
        this.codbien = codbien;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public Scittbescun getScittbescunid() {
        return scittbescunid;
    }

    public void setScittbescunid(Scittbescun scittbescunid) {
        this.scittbescunid = scittbescunid;
    }

    public Pyivtbusobien getPyivtbusobienid() {
        return pyivtbusobienid;
    }

    public void setPyivtbusobienid(Pyivtbusobien pyivtbusobienid) {
        this.pyivtbusobienid = pyivtbusobienid;
    }

    public Pyivtbestabien getPyivtbestabienid() {
        return pyivtbestabienid;
    }

    public void setPyivtbestabienid(Pyivtbestabien pyivtbestabienid) {
        this.pyivtbestabienid = pyivtbestabienid;
    }

    public Pyivtbcolor getPyivtbcolorid() {
        return pyivtbcolorid;
    }

    public void setPyivtbcolorid(Pyivtbcolor pyivtbcolorid) {
        this.pyivtbcolorid = pyivtbcolorid;
    }

    public Pyfntbactivpoa getPydgtbactivpoaid() {
        return pydgtbactivpoaid;
    }

    public void setPydgtbactivpoaid(Pyfntbactivpoa pydgtbactivpoaid) {
        this.pydgtbactivpoaid = pydgtbactivpoaid;
    }

    @XmlTransient
    public Collection<Pyivtbtrasmob> getPyivtbtrasmobCollection() {
        return pyivtbtrasmobCollection;
    }

    public void setPyivtbtrasmobCollection(Collection<Pyivtbtrasmob> pyivtbtrasmobCollection) {
        this.pyivtbtrasmobCollection = pyivtbtrasmobCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyivtbmobid != null ? pyivtbmobid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyivtbmob)) {
            return false;
        }
        Pyivtbmob other = (Pyivtbmob) object;
        if ((this.pyivtbmobid == null && other.pyivtbmobid != null) || (this.pyivtbmobid != null && !this.pyivtbmobid.equals(other.pyivtbmobid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyivtbmob[ pyivtbmobid=" + pyivtbmobid + " ]";
    }
    
}
